package io.zhifei.modules.sys.system.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.zhifei.common.utils.PageUtils;
import io.zhifei.common.utils.Query;
import io.zhifei.modules.sys.system.dao.MacDao;
import io.zhifei.modules.sys.system.entity.MacEntity;
import io.zhifei.modules.sys.system.service.MacService;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * <p> mac地址管理 </p>
 *
 * @author： WangPeng <br/>
 * @date： 2020/10/10 14:54 <br/>
 * @version： <br/>
 */
@Service
public class MacServiceImpl extends ServiceImpl<MacDao, MacEntity> implements MacService {

    @Autowired
    private MacDao macDao;

    @Override
    public PageUtils queryPage(String params, Integer page, Integer pageSize) {
        Page pageParams = new Page(page, pageSize);
        Page<Map<String, Object>> pageResult = macDao.getMacList(pageParams, params);
        return new PageUtils(pageResult);
    }

    @Override
    public void insert(MacEntity macEntity) {
        macDao.insert(macEntity);
    }

    @Override
    public void update(MacEntity macEntity) {
        macDao.updateById(macEntity);
    }
}
